from collections import deque


def linked_list():
    linkedldist = deque()
    # 尾部添加  O(1)
    linkedldist.append(1)
    linkedldist.append(2)
    linkedldist.append(3)
    # 指定位置添加 O(n)
    linkedldist.insert(2, 99)

    # O(N)
    element = linkedldist[2]

    # O(N)
    index = linkedldist.index(99)

    # 删除元素 O(N)
    linkedldist.remove(1)

    # 删除指定索引的元素 O(1)
    del linkedldist[2]

    # O(N)
    linkedldist[2] = 88

    # O(1)
    length = len(linkedldist)

if __name__ == '__main__':
    linked_list